import Vue from "vue";
import Router from "vue-router";
import Layout from "../components/Layout/Layout.vue";
import Login from "../views/Login";

Vue.use(Router);

export const routes = [
  {
    path: "/welcome",
    name: "首页",
    component: Layout,
    redirect: "/welcome",
    children: [
      {
        path: "/welcome",
        name: "系统欢迎",
        component: () => import("@/views/home/Welcome.vue"),
      },
    ],
  },
  {
    path: "/system",
    name: "系统管理",
    component: Layout,
    icon: "el-icon-setting",
    redirect: "/system/permission",
    children: [
      {
        path: "/system/user",
        name: "用户管理",
        component: () => import("@/views/system/user/List.vue"),
      },
      {
        path: "/system/role",
        name: "角色管理",
        component: () => import("@/views/system/role/List.vue"),
      },
      {
        path: "/system/permission",
        name: "权限管理",
        component: () => import("@/views/system/permission/List.vue"),
      },
      {
        path: "/system/dictType",
        name: "字典类型",
        component: () => import("@/views/dictionaryType/List.vue"),
      },
      {
        path: "/system/dictData",
        name: "字典数据",
        component: () => import("@/views/dictionaryData/List.vue"),
      },
      {
        path: "/system/user/list",
        name: "用户列表",
        component: () => import("@/views/system/user/List.vue"),
      },
      {
        path: "/system/department",
        name: "部门列表",
        component: () => import("@/views/system/department/list.vue"),
      },
      {
        path: "/system/log",
        name: "操作日志",
        component: () => import("@/views/system/operateLog/List.vue"),
      },
    ],
  },
  {
    path: "/customer",
    name: "业务管理",
    component: Layout,
    icon: "el-icon-setting",
    redirect: "/customer/index",
    children: [
      {
        path: "/customer/index",
        name: "客户列表",
        component: () => import("@/views/property/customer/List.vue"),
      },
      {
        path: "/customer/detail",
        name: "客户详情",
        component: () => import("@/views/property/customer/Detail.vue"),
      },
      {
        path: "/customer/fund",
        name: "客户资金列表",
        component: () => import("@/views/property/customer/FundList.vue"),
      },
      {
        path: "/customer/fund/detail/:id",
        name: "客户资金详情",
        component: () => import("@/views/property/customer/FundDetail.vue"),
      },
      {
        path: "/order/list",
        name: "订单列表",
        component: () => import("@/views/order/list.vue"),
      },
      {
        path: "/order/detail/:id",
        name: "订单详情",
        component: () => import("@/views/order/Detail.vue"),
      },
      {
        path: "/inventory/list",
        name: "库存管理",
        component: () => import("@/views/inventory/List.vue"),
      },
      {
        path: "/inventory/detail",
        name: "库存详情",
        component: () => import("@/views/inventory/Detail.vue"),
      },
    ],
  },
  // {
  //   path: '/order',
  //   name: '订单管理',
  //   component: Layout,
  //   icon: 'el-icon-s-order',
  //   redirect: "/order/list",
  //   children: [
  //     {
  //       path: '/order/list',
  //       name: '订单列表',
  //       component: () => import('@/views/order/list.vue'),
  //     },
  //     {
  //       path: '/order/detail/:id',
  //       name: '订单详情',
  //       component: () => import('@/views/order/Detail.vue'),
  //     },

  //   ],
  // },
  {
    path: "/bank",
    name: "银行管理",
    component: Layout,
    icon: "el-icon-s-order",
    redirect: "/bank/list",
    children: [
      {
        path: "/bank/list",
        name: "银行列表",
        component: () => import("@/views/bank/List.vue"),
      },
    ],
  },
  {
    path: "/statistics",
    name: "统计管理",
    component: Layout,
    icon: "el-icon-s-marketing",
    redirect: "/statistics/index",
    children: [
      {
        path: "/statistics/index",
        name: "统计",
        component: () => import("@/views/statistics/index.vue"),
      },
    ],
  },
  {
    path: "/recharge",
    name: "对冲工作台",
    component: Layout,
    icon: "el-icon-s-marketing",
    redirect: "/recharge/index",
    children: [
      {
        path: "/recharge/index",
        name: "对冲工作台",
        component: () => import("@/views/recharge/index.vue"),
      },
    ],
  },
  // {
  //   path: '/inventory',
  //   name: '库存管理',
  //   component: Layout,
  //   icon: 'el-icon-s-marketing',
  //   redirect: "/inventory/list",
  //   children: [
  //     {
  //       path: '/inventory/list',
  //       name: '库存管理',
  //       component: () => import('@/views/inventory/List.vue'),
  //     },
  //     {
  //       path: '/inventory/detail',
  //       name: '库存详情',
  //       component: () => import('@/views/inventory/Detail.vue'),
  //     },
  //   ],
  // },
  {
    path: "/",
    name: "登录",
    component: Login,
  },
];

const router = new Router({
  routes,
});

export default router;
